Skip to content

fix(cms): stop reusing the Turbopack build cache across Vercel deploys - #264

Merged
dogfrogfog merged 1 commit into
mainfrom
fix/cms-stale-turbopack-build-cache
Nov 25, 2026
Merged

dogfrogfog merged 1 commit into
mainfrom
fix/cms-stale-turbopack-build-cache

Conversation

@dogfrogfog

Copy link
Copy Markdown
Member

What

  • Production builds of apps/cms no longer reuse the Turbopack filesystem cache that Vercel restores from the previous deployment.
  • This fixes the missing redesign spacing on https://ideal-cms.vercel.app: section paddings, the heading-to-grid gap and the card grid gap.
  • Root cause: deployment dpl_5y8UQTWxq54TQ6zyijp2EwMFD3Pe (commit daf914b, "Restored build cache from previous deployment") shipped the pre-redesign apps/cms/src/app/(frontend)/styles.css merged with the new base.css.
  • A redeploy of the same commit without build cache (dpl_3xGAPRYNr8ouqmFyPAr4rRYzJ45H, now live) produced correct CSS, so production is already fixed; this PR stops it from coming back.

Demo

No before screenshot: the broken deployment is behind Vercel Deployment Protection, and getting past it would mean creating a bypass secret on the project.
Measured on production at 1440px, cards section ("What's inside"):

                         before (cached build)        after (no cache)
:root --grid-gap         (unset)                      24px
:root --section-pt-base  (unset)                      clamp(72px, 11.1vw, 160px)
--container-max-width    1180px  (old styles.css)     1440px
.gap-gridGap / .pt-sectionTop rules in CSS   absent   present
section padding-top      0px                          159.84px
hgroup margin-bottom     0px                          80px
card grid gap            normal (0)                   24px
After
After: section padding-top, hgroup margin-bottom and grid gap on production

Decisions

  • Turn off experimental.turbopackFileSystemCacheForBuild (default true in Next 16.3.6) instead of setting VERCEL_FORCE_NO_BUILD_CACHE: it only drops the cache that produced stale output and keeps Turbo task caching and the rest of the Vercel build cache.
  • Rejected hardcoding the token values or duplicating the variables: the source CSS is correct, a clean build compiles it correctly.

Assumptions

  • The stale output came from the restored Turbopack cache, not from Vercel's CDN: the inline CSS in the HTML changed only after a rebuild without cache, on the same commit.
  • I could not pin the exact Turbopack invalidation bug; a local build over a local old cache did not reproduce it.

Risks

  • Slower builds: next build compile went from 25s (warm cache) to 59s (cold). Rollback: remove the flag from apps/cms/next.config.mjs.

How to verify

  1. Open the preview deployment of this PR, then the build log: there is no Turbopack cache restore for next build.
  2. On the preview /en at 1440px, the "What's inside" section has padding-top about 160px, hgroup margin-bottom 80px, card grid gap 24px.
  3. In DevTools, getComputedStyle(document.documentElement).getPropertyValue('--grid-gap') returns 24px.

Out of scope

  • Home page, header and footer content still from the old light design; that is being rebuilt through the CMS MCP separately.
  • Re-enabling the build cache after an upstream Next.js fix.

Next 16.3 turns on turbopackFileSystemCacheForBuild by default, and Vercel
restores .next/cache from the previous deployment. The production build of
daf914b reused that cache and shipped the pre-redesign styles.css (old :root
and @theme), so every redesign spacing token (pt-sectionTop, gap-gridGap,
mb-sectionGap, min-h-header...) compiled to nothing. A redeploy without
build cache produced the correct CSS.

Scope: apps/cms next.config.mjs
@vercel

vercel Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ideal-cms Ready Ready Preview Nov 25, 2026 3:25pm UTC

Request Review

@dogfrogfog
dogfrogfog merged commit 87fdb48 into main Nov 25, 2026
2 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 3.1.0 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.11.1 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.3.0 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.13.1 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.7.2 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.0.2 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

This branch was successfully deployed

1 active deployment
Preview — bb8a7594 Deployed Nov 25, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant